<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="/Admin/tpl/Css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="/Admin/tpl/Css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="/Admin/tpl/Css/style.css" />
    <script type="text/javascript" src="/Admin/tpl/Js/jquery.js"></script>
    <script type="text/javascript" src="/Admin/tpl/Js/jquery.sorted.js"></script>
    <script type="text/javascript" src="/Admin/tpl/Js/bootstrap.js"></script>
    <script type="text/javascript" src="/Admin/tpl/Js/ckform.js"></script>
    <script type="text/javascript" src="/Admin/tpl/Js/common.js"></script>
	<script charset="utf-8" src="/include/editor/kindeditor.js"></script>
	<script charset="utf-8" src="/include/editor/lang/zh_CN.js"></script>
	<script language="javascript" type="text/javascript" src="/include/datecj/WdatePicker.js"></script>

	<script>
			KindEditor.ready(function(K) {
					window.editor = K.create('#content');
			});
	</script>
    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }
		label{ float:left; padding:0 5px;}

    </style>
</head>
<body>
<form action="{:U('Product/editok')}" enctype="multipart/form-data" method="post" class="definewidth m20">
<table class="table table-bordered table-hover definewidth m10">
<input type="hidden" name="product_id" value='{$product.product_id}'/>
<input type="hidden" name="class_id" value='{$product.lanmu_id}'/>
    <tr>
        <td width="10%" class="tableleft">商品名称</td>
        <td><input type="text" name="title" value='{$product.title}'/></td>
    </tr>
    <tr>
        <td class="tableleft">商品分类</td>
        <td>
			<select name='classid'>
				<option value="0">选择商品分类</option>
				<Volist name='class' id='vo'>
					<option value ="{$vo.class_id}" <if condition="$vo.class_id eq $product[classid]">selected="selected"</if> >{$vo.class_name}</option>
				</Volist>
			</select>
		</td>
    </tr>
	<tr>
        <td class="tableleft">商品品牌</td>
        <td>
			<select name='pinpai_id'>
				<option value="0">选择商品品牌</option>
				<Volist name='pinpai' id='vo'>
					<option value ="{$vo.pinpai_id}" <if condition="$vo.pinpai_id eq $product[pinpai_id]">selected="selected"</if> >{$vo.pinpai_name}</option>
				</Volist>
			</select>
			<a href='__APP__/Pinpai/add' target='_blank'>添加品牌</a>
		</td>
    </tr>
	<tr>
        <td class="tableleft">商品图片</td>
        <td><img src='/uploadfiles/{$product.image}' width='70'/><input type="file" name="image" /></td>
    </tr>
    <tr>
        <td class="tableleft">商品图片2</td>
        <td><img src='/uploadfiles/{$product.image2}' width='70'/><input type="file" name="image2"/></td>
    </tr>
	<tr>
        <td class="tableleft">商品图片3</td>
        <td><img src='/uploadfiles/{$product.image3}' width='70'/><input type="file" name="image3"/></td>
    </tr>
	<tr>
        <td class="tableleft">商品价格</td>
        <td><input type="text" name="price" value='{$product.price}'/></td>
    </tr>
	<tr>
        <td class="tableleft">商品状态</td>
        <td>
			<label><input type="checkbox"<?php if(strstr($product[zhuangtai],'1')){echo 'checked="true"';} ?> name="zhuangtai[]" value='1'/>新品</label>
			<label><input type="checkbox"<?php if(strstr($product[zhuangtai],'2')){echo 'checked="true"';} ?> name="zhuangtai[]" value='2'/>热销</label>
			<label><input type="checkbox"<?php if(strstr($product[zhuangtai],'3')){echo 'checked="true"';} ?> name="zhuangtai[]" value='3'/>精品</label>
			<label><input type="checkbox"<?php if(strstr($product[zhuangtai],'4')){echo 'checked="true"';} ?> name="zhuangtai[]" value='4'/>推荐</label>
			<label><input type="checkbox"<?php if(strstr($product[zhuangtai],'5')){echo 'checked="true"';} ?> name="zhuangtai[]" value='5'/>超值</label>
		</td>
    </tr>
	<tr>
        <td class="tableleft">订单</td>
        <td><input type="text" name="dingdan" value='{$product.dingdan}'/></td>
    </tr>
	<tr>
        <td class="tableleft">销量</td>
        <td><input type="text" name="xiaoliang" value='{$product.xiaoliang}'/></td>
    </tr>
	<tr>
        <td class="tableleft">库存</td>
        <td><input type="text" name="kucun" value='{$product.kucun}'/></td>
    </tr>
	<tr>
        <td class="tableleft">人气</td>
        <td><input type="text" name="renqi" value='{$product.renqi}'/></td>
    </tr>
	<tr>
        <td class="tableleft">上传时间</td>
        <td><input type="text" name="uptime" onClick="WdatePicker()" value='{$product.uptime}' /></td>
    </tr>
	<tr>
        <td class="tableleft">修改时间</td>
        <td><input type="text" name="xiugaitime" onClick="WdatePicker()" value='{$product.xiugaitime}' /></td>
    </tr>
	<tr>
        <td class="tableleft">商品介绍</td>
        <td><textarea id='content' name='content' style="width:900px;height:500px;">{$product.content}</textarea></td>
    </tr>
    <tr>
        <td class="tableleft"></td>
        <td>
            <button type="submit" class="btn btn-primary" type="button">保存</button> &nbsp;&nbsp;<button type="button" class="btn btn-success" name="backid" id="backid">返回列表</button>
        </td>
    </tr>
</table>
</form>
</body>
</html>
<script>
    $(function () {       
		$('#backid').click(function(){
				window.location.href="__APP__/Product/index?id={$product.lanmu_id}";
		 });

    });
</script>